home *** CD-ROM | disk | FTP | other *** search
/ Chip 2006 July / CHIP 2006-07.2.iso / program / web_gelistirme / easyphp1-7_setup.exe / {app} / home / index.php < prev    next >
Encoding:
PHP Script  |  2003-09-11  |  12.2 KB  |  323 lines

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <title>[EasyPHP] - Administration</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  6. <link rel="stylesheet" href="styles.css" type="text/css">
  7. </head>
  8.  
  9. <body>
  10.  
  11. <?php
  12.  
  13. include("i18n_fr.php");
  14.  
  15. if (isset($HTTP_GET_VARS)){
  16.     while(list($name, $value) = each($HTTP_GET_VARS)){
  17.         $$name = $value;
  18.     }
  19. }
  20. if (!isset($to)) $to = '';
  21. if (!isset($_POST['to'])) $_POST['to'] = '';
  22. if (!isset($exts)) $exts = '';
  23. if (!isset($exts)) $do = '';
  24. if (!isset($exts)) $directory = '';
  25.  
  26. function bouton($word, $lien, $cible){
  27.     $lenght=strlen($word);
  28.     $start = 0;
  29.     print("<table border='0' cellspacing='0' cellpadding='0'>");
  30.     print("<tr><td><img src='images_easyphp/bouton_gauche.gif' width='4' height='26'></td><td background='images_easyphp/bouton_fond.gif'>");
  31.     print("<a href=$lien $cible>");  
  32.     while($start<$lenght){
  33.         $car=substr($word,$start,1);
  34.         print("<img src='images_easyphp/lettre_".$car.".gif' border='0'>");
  35.         $start++;
  36.     }
  37.     print("</a>");  
  38.     print("</td><td><img src='images_easyphp/bouton_droit.gif' width='4' height='26'></td></tr></table>");
  39. }
  40.  
  41. function bouton_fleche($word,$lien, $cible){
  42.     $lenght=strlen($word);
  43.     $start = 0;
  44.     print("<table border='0' cellspacing='0' cellpadding='0'>");
  45.     print("<tr><td><img src='images_easyphp/bouton_fleche_gauche.gif' width='4' height='26'></td><td background='images_easyphp/bouton_fleche_fond.gif'>");
  46.     print("<a href=$lien $cible>");   
  47.     while($start<$lenght){
  48.         $car=substr($word,$start,1);
  49.         print("<img src='images_easyphp/lettre_".$car.".gif' border='0'>");
  50.         $start++;
  51.     }
  52.     print("</a>");   
  53.     print("</td><td><img src='images_easyphp/bouton_fleche_droit.gif' width='4' height='26'></td></tr></table>");
  54. }
  55.  
  56. function num_version($num){
  57.     $lenght=strlen($num);
  58.     $start = 0;
  59.     while($start<$lenght){
  60.         $chiffre=substr($num,$start,1);
  61.         print("<img src='images_easyphp/chiffre_".$chiffre.".gif' border='0'>");
  62.         $start++;
  63.     }
  64. }
  65. ?>
  66. <div align="center">
  67. <table width="400" cellspacing="0" cellpadding="0" border="0" align="center">
  68. <tr>
  69. <td>
  70. <a href="index.php"><img src="images_easyphp/titre_easyphp_admin.gif" width="387" height="116" border="0"></a>
  71. </td>
  72. </tr>
  73. <tr>
  74. </table>
  75. </div>
  76.  
  77.  
  78.  
  79. <div align="center">
  80. <table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
  81. <tr> 
  82. <td class="text1">
  83. Une <b>introduction</b> α EasyPHP, une section "<b>support</b>" et une <b>faq PHP</b> sont prΘsentes sur la page d' <a href="accueil.html"><img src="images_easyphp/accueil.gif" width="60" height="12" border="0" align="absbottom"></a> 
  84. </td>
  85. </tr>
  86. </table>
  87. </div>
  88.  
  89. <br><br>
  90.  
  91. <div align="center">
  92. <table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
  93. <tr> 
  94. <td width="200" nowrap> <img src="images_easyphp/cube_rouge.gif" width="18" height="26"><img src="images_easyphp/1x1.gif" width="5" height="26"><img src="images_easyphp/apache.gif" width="74" height="26"><img src="images_easyphp/1x1.gif" width="5" height="26">
  95. <?php num_version($version_apache) ?>
  96. </td>
  97. <td>
  98.  
  99. <table border="0" cellpadding="0" cellspacing="5">
  100. <tr>
  101. <td bgcolor="#666666"><?php bouton_fleche($bouton_alias, "index.php", "") ?></td>
  102. <td><img src="images_easyphp/1x1.gif" width="20" height="26"></td>
  103. <td><?php bouton($licence, "licence_apache.php", "") ?></td>
  104. </tr>
  105. </table>
  106. </td>
  107. </tr>
  108. <tr> 
  109. <td> </td>
  110. <td class="text1"> 
  111.  
  112. <?php
  113. //===================================================================================================
  114. function read_alias(){
  115.     global $alias, $directory, $httpd, $httpd_1, $n, $httpd_2, $httpd_3, $nb_alias, $source;
  116.     $source = "../apache/conf/httpd.conf";
  117.     $fp = fopen($source, "r");
  118.     $httpd = "";
  119.     while (!feof($fp)){
  120.         $conf = fgets($fp, 4096);
  121.         $httpd = $httpd.$conf;
  122.     }
  123.     fclose($fp);
  124.     $exp1 = explode("#alias",$httpd);
  125.     $httpd_1 = $exp1[0];
  126.     $httpd_2 = $exp1[1];
  127.     $httpd_3 = $exp1[2];
  128.     $exp2 = explode("Alias",$httpd_2);
  129.     
  130.     $n = 1;
  131.     $nb_alias = count($exp2)-1;
  132.     while($n<=$nb_alias){
  133.         $exp3 = explode("<Directory",$exp2[$n]);
  134.         $alias[$n] = "Alias".$exp3[0];
  135.         $directory[$n] = "<Directory".$exp3[1];
  136.         $n++;
  137.     }
  138. }
  139.  
  140. function list_alias(){
  141.     global $inc, $alias, $nb_alias, $exp4, $exp5, $alias_link, $nb_alias, $alias_name;
  142.     $inc = 1;
  143.     while($inc <= $nb_alias){
  144.         $exp4 = explode("\"",$alias[$inc]);
  145.         $exp5 = explode("/",$exp4[1]);
  146.         $alias_link = $exp4[3];
  147.         $alias_name = $exp5[1];
  148.         $alias_link = str_replace("/","\\", $alias_link);
  149.         print("<table border='0' cellspacing='0' cellpadding='0'>");
  150.         print("<tr>");
  151.         print("<td class='text1' valign='top'>");
  152.         print("<img src='images_easyphp/1x1.gif' width='10' height='16' align='absbottom'><img src='images_easyphp/dossier_alias.gif' width='23' height='16' align='absbottom'> ");
  153.         print("</td>");
  154.         print("<td class='text1'>");
  155.         print("<a href='../$alias_name/' target='_blank' class='text1'>$alias_name</a>    [ $alias_link ]    ");
  156.         print("[ <a href='index.php?to=del_alias&num_alias=$inc' class=text2>supprimer</a> ]<br>");
  157.         print("</td>");
  158.         print("</tr>");
  159.         print("</table>");
  160.         $inc++;
  161.     }
  162.     print("<img src='images_easyphp/1x1.gif' width='10' height='16' align='absbottom'><img src='images_easyphp/dossier_alias.gif' width='23' height='16' align='absbottom'> ");
  163.     print("...    ");
  164.     print("[ <a href='index.php?to=add_alias_1' class=text2>ajouter</a> ]<br><br>");
  165. }        
  166.  
  167. if ($to == "add_alias_1"){
  168. ?>
  169. <form method="post" action="index.php">
  170. Les alias permettent de placer vos développements dans un ou plusieurs répertoires indépendamment du répertoire racine d'apache (www).
  171. <br><br>
  172. <img src="images_easyphp/num_1.gif" width="14" height="18" align="absbottom"> créer votre répertoire (ex.: C:\weblocal\sites\site1) <br>
  173. <img src="images_easyphp/num_2.gif" width="14" height="18" align="absbottom"> saisir un nom pour l'alias (ex.: site1)<br>
  174. <img src="images_easyphp/1x1.gif" width="14" height="18" align="absbottom"><input type="text" name="alias_name" size="50"><br>
  175. <img src="images_easyphp/num_3.gif" width="14" height="18" align="absbottom"> saisir le chemin du répertoire créé (ex.: C:\weblocal\sites\site1)<br>
  176. <img src="images_easyphp/1x1.gif" width="14" height="18" align="absbottom"><input type="text" name="alias_link" size="50"><br>
  177. <img src="images_easyphp/num_4.gif" width="14" height="18" align="absbottom"> paramètres par défaut du répertoire<br>
  178. <img src="images_easyphp/1x1.gif" width="14" height="18" align="absbottom"><textarea name="dir" cols="45" rows="4" wrap="virtual">Options Indexes FollowSymLinks Includes
  179. AllowOverride All
  180. #Order allow,deny
  181. Allow from all
  182. </textarea>
  183. <br>
  184. <img src="images_easyphp/num_5.gif" width="14" height="18" align="absbottom"> valider ("OK")<br>
  185. <img src="images_easyphp/num_6.gif" width="14" height="18" align="absbottom"> cliquer sur redémarrer et attendre que apache et mysql repassent au vert dans le statut.
  186. <br><br>
  187. <input type="hidden" name="to" value="add_alias_2">
  188. <input type="image" src="images_easyphp/bouton_valider.gif" border="0" width="38" height="18" alt="envoyer">
  189. <br><br>
  190. rq : il existe une copie de secours du fichier httpd.conf dans le rΘpertoire "safe" : httpd-safe.conf
  191. </form>
  192.              
  193. <?php
  194. }elseif ($_POST['to'] == "add_alias_2"){
  195.         if ($_POST['alias_name'] == "" | $_POST['alias_link'] == "" | !is_dir($_POST['alias_link'])){
  196.             if ($_POST['alias_name'] == ""){print("  <img src='images_easyphp/exclam.gif' width='10' height='18' align='absbottom'> le champ 2 est vide.<br>");}
  197.             if ($_POST['alias_link'] == ""){print("  <img src='images_easyphp/exclam.gif' width='10' height='18' align='absbottom'> le champ 3 est vide.<br>");}
  198.             if ($_POST['alias_link'] != "" & !is_dir($_POST['alias_link'])){print("  <img src='images_easyphp/exclam.gif' width='10' height='18' align='absbottom'> le répertoire correspondant au chemin que vous avez saisi n'existe pas.<br>");}
  199.             print("  [ <a href=\"javascript:history.back()\" class=\"text2\">retour</a> ]<br><br>");
  200.             clearstatcache();
  201.         }else{
  202.             read_alias();
  203.             $dir = ereg_replace("\r\n","\n",$_POST['dir']);
  204.             //$alias_link = stripslashes($_POST['alias_link']);
  205.             $alias_link = str_replace("\\","/", $_POST['alias_link']);
  206.             
  207.             if (substr($alias_link, -1) == "/"){$alias_link = substr($alias_link,0,strlen($alias_link)-1);}
  208.             $new_alias = "Alias \"/";
  209.             $new_alias .= $_POST['alias_name'];
  210.             $new_alias .= "\" \"";
  211.             $new_alias .= $alias_link;
  212.             $new_alias .= "/\"\n";
  213.             $new_alias .= "<Directory \"$alias_link\">\n".$dir."</Directory>\n\n";
  214.             $conf = $httpd_1."#alias".$httpd_2.$new_alias."#alias\n".$httpd_3;
  215.             $fp2 = fopen($source, "w");
  216.             fputs($fp2,$conf);
  217.             fclose($fp2);
  218.             read_alias();
  219.             list_alias();
  220.         }
  221. }elseif ($to == "del_alias"){
  222.         read_alias();
  223.         $conf_del_alias = $httpd_1."#alias\n";
  224.         $x = 1;
  225.         while($x<=$nb_alias){
  226.             if ($x != $num_alias){$conf_del_alias = $conf_del_alias.$alias[$x].$directory[$x];}
  227.             $x++;
  228.         }
  229.         $conf_del_alias = $conf_del_alias."#alias\n".$httpd_3;
  230.         $fp3 = fopen($source, "w");
  231.         fputs($fp3,$conf_del_alias);
  232.         fclose($fp3);
  233.         read_alias();
  234.         list_alias();
  235. }else{
  236.         read_alias();
  237.         list_alias();
  238. }
  239. //===========================================================================================
  240. ?>
  241.  
  242. </td>
  243. </tr>
  244.  
  245.  
  246. <tr> 
  247. <td nowrap><img src="images_easyphp/cube_rouge.gif" width="18" height="26"><img src="images_easyphp/1x1.gif" width="5" height="26"><img src="images_easyphp/php.gif" width="38" height="26"><img src="images_easyphp/1x1.gif" width="5" height="26"><?php num_version($version_php) ?></td>
  248. <td>
  249.  
  250. <table border="0" cellpadding="0" cellspacing="5">
  251. <tr>
  252. <td bgcolor="#666666"><?php bouton_fleche($ext, "index.php", "") ?></td>
  253. <td><img src="images_easyphp/1x1.gif" width="20" height="26"></td>
  254. <td><?php bouton($phpinfo, "phpinfo.php", "") ?></td>
  255. <td><?php bouton($licence, "licence_php.php", "") ?></td>
  256. <td> </td>
  257. </tr>
  258. </table>
  259. </td>
  260.  
  261. <tr>
  262. <td></td>
  263. <td class="text1">
  264.  
  265. <?php
  266. //===========================================================================================
  267. $extensions = @get_loaded_extensions();
  268. print("   Vous avez ".count($extensions)." extensions chargées [ <a href='index.php?to=ext' class=text2>afficher</a> ]<br>");
  269. if ($to=="ext"){
  270.     @sort($extensions);
  271.     foreach($extensions as $extension){
  272.         print("      <img src='/images_easyphp/carre_jaune.gif' width='10' height='10' align='absbottom'> $extension  [ <a href='index.php?to=ext&exts=$extension' class=text2>fonctions</a> ]<br>");
  273.         if ($extension==$exts){
  274.             $functions = @get_extension_funcs($exts);
  275.             @sort($functions);
  276.             foreach($functions as $function){print("                • $function<br>");}
  277.         }
  278.     }
  279. }
  280. print("<br>");
  281. //===========================================================================================
  282. ?>
  283.  
  284. </td>
  285. </tr>
  286. <tr> 
  287. <td nowrap><img src="images_easyphp/cube_rouge.gif" width="18" height="26"><img src="images_easyphp/1x1.gif" width="5" height="26"><img src="images_easyphp/phpmyadmin.gif" width="128" height="26"><img src="images_easyphp/1x1.gif" width="5" height="26"><?php num_version($version_phpmyadmin) ?></td>
  288. <td>
  289.  
  290. <table border="0" cellpadding="0" cellspacing="5">
  291. <tr>
  292. <td><?php bouton($gestion_bdd, "/mysql/", "target='_blank'") ?></td>
  293. <td><?php bouton($licence, "licence_phpmyadmin.php", "") ?></td>
  294. <td> </td>
  295. </tr>
  296. </table>
  297.  
  298. </td>
  299. </tr>
  300.  
  301.  
  302.  
  303. <tr> 
  304. <td nowrap>
  305. <img src="images_easyphp/cube_rouge.gif" width="18" height="26"><img src="images_easyphp/1x1.gif" width="5" height="26"><img src="images_easyphp/mysql.gif" width="68" height="26"><img src="images_easyphp/1x1.gif" width="5" height="26"><?php num_version($version_mysql) ?>
  306. </td>
  307. <td>
  308.  
  309. <table border="0" cellpadding="0" cellspacing="5">
  310. <tr>
  311. <td><?php bouton($licence, "licence_mysql.php", "") ?></td>
  312. <td> </td>
  313. </tr>
  314. </table>
  315.  
  316. </td>
  317. </tr>
  318.  
  319. </table>
  320. </div>
  321.  
  322. </body>
  323. </html>